D r a w G a m e ( ) ; 
 
 D r a w G r e e n ( ) ; 
 
 D r a w R e d ( ) ; 
 
 D r a w B l u e ( ) ; 
 
 D r a w Y e l l o w ( ) ; 
 
 P l a y S e q u e n c e ( ) ; 
 
 P r i n t C o u n t ( ) ; 
 
 A r c P A n g l e ( ) ; 
 
 I n t T o S t r i n g ( ) ; 
 
 D i g i t T o C h a r ( ) ; 
 
 s e q u e n c e ;   / / 1 - g r e e n ,   2 - r e d ,   3 - y e l l o w ,   4 - b l u e 
 
 a n g l e M o d e C h a n g e ; 
 
 
 
 E X P O R T   S i m o n ( ) 
 
 / / S i m o n   v 1 . 3 
 
 / / 2 0 2 0 
 
 / / T o n y   G a l l o 
 
 / / t g a l l o @ t b a y t e l . c o m 
 
 / / h t t p : / / m y . t b a y t e l . n e t / t g a l l o / h p   p r i m e 
 
 
 
 B E G I N 
 
 l o c a l   c o l o r l i s t ; 
 
 l o c a l   t o u c h ; 
 
 L O C A L   X , Y ; 
 
 l o c a l   c h o i c e ; 
 
 l o c a l   d o n e ; 
 
 l o c a l   s t a r t ; 
 
 l o c a l   t o u c h c o u n t ; 
 
 l o c a l   e r r o r ; 
 
 l o c a l   k e y ; 
 
 
 
 / / t i t l e   s c r e e n 
 
 R E C T _ P ( 0 , 0 , 3 1 9 , 2 3 9 , 0 , R G B ( 0 , 0 , 0 ) ) ; 
 
 T E X T O U T _ P ( " S I M O N " , 1 3 7 , 9 0 , 2 , R G B ( 2 5 5 , 0 , 0 ) ) ; 
 
 T E X T O U T _ P ( " v 1 . 3       2 0 2 0 " , 1 3 0 , 1 1 0 , 1 , R G B ( 2 5 5 , 0 , 0 ) ) ; 
 
 T E X T O U T _ P ( " b y   T o n y   G a l l o " , 1 2 5 , 1 3 0 , 1 , R G B ( 2 5 5 , 0 , 0 ) ) ; 
 
 w a i t ( 1 . 5 ) ; 
 
 
 
 
 
 d o n e : =   0 ; 
 
 W H I L E   ( d o n e = = 0 )   D O 
 
 
 
 / / c l e a r   s c r e e n 
 
 R E C T _ P ( 0 , 0 , 3 1 9 , 2 3 9 , 0 , R G B ( 6 0 , 6 0 , 6 0 ) ) ; 
 
 
 
 / / c r e d i t s 
 
 T E X T O U T _ P ( " S I M O N " , 1 0 , 5 , 2 , R G B ( 0 , 0 , 0 ) ) ; 
 
 T E X T O U T _ P ( " v 1 . 3       2 0 2 0 " , 1 0 0 , 6 , 1 , R G B ( 0 , 0 , 0 ) ) ; 
 
 T E X T O U T _ P ( " b y   T o n y   G a l l o " , 2 5 0 , 5 , 1 , R G B ( 0 , 0 , 0 ) ) ; 
 
 
 
 
 
 / / d e t e r m i n e   i f   a n g l e   m o d e   i s   i n   R a d i a n s   o r   D e g r e e s 
 
 i f   ( A A n g l e   = =   2 )   o r   ( A A n g l e   = =   0   a n d   H A n g l e   = =   1 )   t h e n 
 
       / / D e g r e e s 
 
       a n g l e M o d e C h a n g e : = 1 ; 
 
 e l s e 
 
       / / R a d i a n s 
 
       a n g l e M o d e C h a n g e : = 0 ; 
 
 e n d ; 
 
 
 
 D r a w G a m e ( ) ; 
 
 s e q u e n c e : = " " ; 
 
 s t a r t : = 0 ; 
 
 
 
 T E X T O U T _ P ( " T o u c h   s c r e e n " , 2 0 , 3 5 , 2 , R G B ( 0 , 0 , 0 ) ) ; 
 
 T E X T O U T _ P ( " t o   b e g i n . " , 2 0 , 4 7 , 2 , R G B ( 0 , 0 , 0 ) ) ; 
 
 W H I L E   I S K E Y D O W N ( 4 ) < > 1   a n d   s t a r t   = =   0   d o 
 
       w a i t ( . 1 ) ; 
 
       t o u c h : = m o u s e ( ) ; 
 
 
 
           i f   s i z e ( t o u c h ( 1 ) )   t h e n 
 
                     i f     t o u c h ( 1 , 5 ) = = 0   t h e n 
 
             s t a r t : = 1 ; 
 
       e n d ; 
 
           e n d ; 
 
 E N D ; 
 
 
 
 i f   s t a r t = = 0   t h e n 
 
 / / m u s t   h a v e   p r e s s e d   E s c 
 
 
 
   r e t u r n ; 
 
 e n d ; 
 
 
 
 
 
 / / c l e a r   s t a r t   m e s s a g e 
 
 R E C T _ P ( 2 0 , 3 5 , 9 5 , 6 0 , R G B ( 6 0 , 6 0 , 6 0 ) , R G B ( 6 0 , 6 0 , 6 0 ) ) ; 
 
 
 
 P r i n t C o u n t ( 0 ) ; 
 
 P l a y S e q u e n c e ( ) ; 
 
 t o u c h c o u n t : = 0 ; 
 
 e r r o r : = 0 ; 
 
 W H I L E   I S K E Y D O W N ( 4 ) < > 1   d o 
 
 
 
 
 
       t o u c h : = m o u s e ( ) ; 
 
 
 
         i f   s i z e ( t o u c h ( 1 ) )   t h e n 
 
           i f     t o u c h ( 1 , 5 ) = = 0   t h e n 
 
                             X : = B !R ( t o u c h ( 1 , 1 ) ) ; 
 
                             Y : = B !R ( t o u c h ( 1 , 2 ) ) ; 
 
 
 
       
 
             i f   8 0 < = X < = 1 6 0   a n d   5 0 < = Y < = 1 3 0   T H E N 
 
       t o u c h c o u n t : = t o u c h c o u n t + 1 ; 
 
       i f   M I D ( s e q u e n c e , t o u c h c o u n t , 1 )   < >   " G "   t h e n   e r r o r : = 1 ;   e n d ; 
 
                   D r a w G r e e n ( 1 ) ; 
 
                   w a i t ( 0 . 2 5 ) ; 
 
                   D r a w G r e e n ( 0 ) ; 
 
             e n d ; 
 
 
 
             i f   1 6 0 < = X < = 2 4 0   a n d   5 0 < = Y < = 1 3 0   T H E N 
 
       t o u c h c o u n t : = t o u c h c o u n t + 1 ; 
 
       i f   M I D ( s e q u e n c e , t o u c h c o u n t , 1 )   < >   " R "   t h e n   e r r o r : = 1 ;   e n d ; 
 
                   D r a w R e d ( 1 ) ; 
 
                   w a i t ( 0 . 2 5 ) ; 
 
                   D r a w R e d ( 0 ) ; 
 
             e n d ; 
 
 
 
             i f   8 0 < = X < = 1 6 0   a n d   1 3 0 < = Y < = 2 1 0   T H E N 
 
       t o u c h c o u n t : = t o u c h c o u n t + 1 ; 
 
       i f   M I D ( s e q u e n c e , t o u c h c o u n t , 1 )   < >   " Y "   t h e n   e r r o r : = 1 ;   e n d ; 
 
                   D r a w Y e l l o w ( 1 ) ; 
 
                   w a i t ( 0 . 2 5 ) ; 
 
                   D r a w Y e l l o w ( 0 ) ; 
 
             e n d ; 
 
 
 
             i f   1 6 0 < = X < = 2 4 0   a n d   1 3 0 < = Y < = 2 1 0   T H E N 
 
       t o u c h c o u n t : = t o u c h c o u n t + 1 ; 
 
       i f   M I D ( s e q u e n c e , t o u c h c o u n t , 1 )   < >   " B "   t h e n   e r r o r : = 1 ;   e n d ; 
 
                   D r a w B l u e ( 1 ) ; 
 
                   w a i t ( 0 . 2 5 ) ; 
 
                   D r a w B l u e ( 0 ) ; 
 
             e n d ; 
 
 
 
             i f   e r r o r = = 1   t h e n 
 
         T E X T O U T _ P ( " G A M E   O V E R ! " , 2 4 8 , 3 5 , 2 , R G B ( 0 , 0 , 0 ) ) ; 
 
                           T E X T O U T _ P ( " P r e s s   a n y " , 2 5 2 , 5 0 , 2 , R G B ( 0 , 0 , 0 ) ) ; 
 
                           T E X T O U T _ P ( " k e y . " , 2 6 2 , 6 5 , 2 , R G B ( 0 , 0 , 0 ) ) ; 
 
       b r e a k ; 
 
             e n d ; 
 
 
 
             w a i t ( . 1 ) ; 
 
 
 
             i f   t o u c h c o u n t   = =   D I M ( s e q u e n c e )   t h e n 
 
       P r i n t C o u n t ( t o u c h c o u n t ) ; 
 
       w a i t ( . 2 ) ; 
 
         P l a y S e q u e n c e ( ) ; 
 
         t o u c h c o u n t : = 0 ; 
 
             e n d ; 
 
           e n d ; 
 
         e n d ;       
 
 E N D ; 
 
 
 
 k e y : = - 1 ; 
 
 w h i l e   k e y   =   - 1   d o 
 
         w a i t ( . 1 ) ; 
 
       t o u c h : = m o u s e ( ) ; 
 
           k e y : = g e t k e y ; 
 
 e n d ; 
 
 
 
 
 
 C H O O S E ( c h o i c e ,   " P l a y   A g a i n ? " ,   " Y e s " ,   " N o " ) ; 
 
 i f   c h o i c e   < >   1   t h e n   d o n e : = 1 ;   e n d ; 
 
 E N D ; 
 
 
 
 E N D ; 
 
 
 
 D r a w G a m e ( ) 
 
 b e g i n 
 
 
 
 l o c a l   I ; 
 
 
 
         F O R   I   F R O M   0   T O   9 0   D O 
 
               A R C _ P ( 1 6 0 , 1 3 0 , I , { R G B ( 0 , 0 , 0 ) , R G B ( 0 , 0 , 0 ) } ) ; 
 
         E N D ; 
 
 
 
         F O R   I   F R O M   0   T O   3 5   D O 
 
               A R C _ P ( 1 6 0 , 1 3 0 , I , { R G B ( 1 4 0 , 1 6 0 , 1 8 0 ) , R G B ( 1 4 0 , 1 6 0 , 1 8 0 ) } ) ; 
 
         E N D ; 
 
 
 
 T E X T O U T _ P ( " S I M O N " , 1 4 2 , 1 1 5 , 2 , R G B ( 0 , 0 , 0 ) ) ; 
 
 
 
 D r a w G r e e n ( 0 ) ; 
 
 D r a w R e d ( 0 ) ; 
 
 D r a w B l u e ( 0 ) ; 
 
 D r a w Y e l l o w ( 0 ) ; 
 
 P r i n t C o u n t ( 0 ) ; 
 
 e n d ; 
 
 
 
 D r a w G r e e n ( l i t ) 
 
 b e g i n 
 
 l o c a l   g r e e n ; 
 
 
 
 i f   l i t = = 1   t h e n 
 
       g r e e n : = R G B ( 0 , 2 5 5 , 0 ) ; 
 
 e l s e 
 
       g r e e n : = R G B ( 1 0 , 1 8 5 , 2 5 ) ; 
 
 e n d ; 
 
 
 
         F O R   I   F R O M   4 5   T O   8 0   D O 
 
               A r c P A n g l e ( 1 6 0 , 1 3 0 , p i / 2 , p i , g r e e n ) ; 
 
         E N D ; 
 
 
 
 e n d ; 
 
 
 
 D r a w R e d ( l i t ) 
 
 b e g i n 
 
 
 
 l o c a l   r e d ; 
 
 
 
 i f   l i t = = 1   t h e n 
 
       r e d : = R G B ( 2 5 5 , 0 , 0 ) ; 
 
 e l s e 
 
       r e d : = R G B ( 2 5 5 , 6 0 , 4 0 ) ; 
 
 e n d ; 
 
 
 
 
 
         F O R   I   F R O M   4 5   T O   8 0   D O 
 
               A r c P A n g l e ( 1 6 0 , 1 3 0 , 2 * p i , p i / 2 , r e d ) ; 
 
         E N D ; 
 
 
 
 
 
 e n d ; 
 
 
 
 D r a w B l u e ( l i t ) 
 
 b e g i n 
 
 
 
 l o c a l   b l u e ; 
 
 
 
 i f   l i t = = 1   t h e n 
 
       b l u e : = R G B ( 0 , 5 0 , 2 5 5 ) ; 
 
 e l s e 
 
       b l u e : = R G B ( 1 0 , 1 8 0 , 2 5 5 ) ; 
 
 e n d ; 
 
 
 
 
 
         F O R   I   F R O M   4 5   T O   8 0   D O 
 
             A r c P A n g l e ( 1 6 0 , 1 3 0 , p i + p i / 2 , 2 * p i , b l u e ) ; 
 
         E N D ; 
 
 
 
 
 
 e n d ; 
 
 
 
 D r a w Y e l l o w ( l i t ) 
 
 b e g i n 
 
 
 
 l o c a l   y e l l o w ; 
 
 
 
 i f   l i t = = 1   t h e n 
 
       y e l l o w : = R G B ( 2 5 5 , 2 5 5 , 0 ) ; 
 
 e l s e 
 
       y e l l o w : = R G B ( 2 5 5 , 2 5 5 , 9 0 ) ; 
 
 e n d ; 
 
 
 
 
 
         F O R   I   F R O M   4 5   T O   8 0   D O 
 
               A r c P A n g l e ( 1 6 0 , 1 3 0 , p i , p i + p i / 2 , y e l l o w ) ; 
 
         E N D ; 
 
 
 
 
 
 e n d ; 
 
 
 
 P l a y S e q u e n c e ( ) 
 
 b e g i n 
 
 
 
 l o c a l   r a n d ; 
 
 l o c a l   c o l o r ; 
 
 l o c a l   I ; 
 
 l o c a l   p a u s e ; 
 
 
 
 r a n d : = R A N D I N T ( 1 , 4 ) ; 
 
 c a s e 
 
       i f   r a n d = = 1   t h e n   c o l o r : = " G "   e n d ; 
 
       i f   r a n d = = 2   t h e n   c o l o r : = " R "   e n d ; 
 
       i f   r a n d = = 3   t h e n   c o l o r : = " Y "   e n d ; 
 
       i f   r a n d = = 4   t h e n   c o l o r : = " B "   e n d ; 
 
 e n d ; 
 
 
 
 s e q u e n c e : =   s e q u e n c e   +   c o l o r ; 
 
 
 
 p a u s e : = 0 . 2 5 - ( 0 . 0 1 * D I M ( s e q u e n c e ) ) ; 
 
 
 
 i f   p a u s e   <   0 . 0 5   t h e n   p a u s e : = 0 . 0 5 ;   e n d ; 
 
 
 
       F O R   I   F R O M   1   t o   D I M ( s e q u e n c e )   D O 
 
 
 
             w a i t ( p a u s e ) ; 
 
 
 
             i f   M I D ( s e q u e n c e , I , 1 )     = =   " G "   t h e n 
 
                   D r a w G r e e n ( 1 ) ; 
 
                   w a i t ( 0 . 2 5 ) ; 
 
                   D r a w G r e e n ( 0 ) ; 
 
             e n d ; 
 
 
 
             i f   M I D ( s e q u e n c e , I , 1 )   = =   " R "   T H E N 
 
                   D r a w R e d ( 1 ) ; 
 
                   w a i t ( 0 . 2 5 ) ; 
 
                   D r a w R e d ( 0 ) ; 
 
             e n d ; 
 
 
 
             i f   M I D ( s e q u e n c e , I , 1 )   = =   " Y "   T H E N 
 
                   D r a w Y e l l o w ( 1 ) ; 
 
                   w a i t ( 0 . 2 5 ) ; 
 
                   D r a w Y e l l o w ( 0 ) ; 
 
             e n d ; 
 
 
 
             i f   M I D ( s e q u e n c e , I , 1 )   = =   " B "   T H E N 
 
                   D r a w B l u e ( 1 ) ; 
 
                   w a i t ( 0 . 2 5 ) ; 
 
                   D r a w B l u e ( 0 ) ; 
 
             e n d ; 
 
 
 
       E N D ; 
 
 
 
 e n d ; 
 
 
 
 
 
 A r c P A n g l e ( x , y , a 1 , a 2 , c o l o u r ) 
 
 b e g i n 
 
 l o c a l   A n g l e M o d e ; 
 
 
 
 i f   a n g l e M o d e C h a n g e = = 1   t h e n 
 
       a 1   : =   a 1 * ( 1 8 0 / p i ) ; 
 
       a 2   : =   a 2 * ( 1 8 0 / p i ) ; 
 
 e n d ; 
 
 
 
 
 
         F O R   I   F R O M   4 5   T O   8 0   D O 
 
               A R C _ P ( x , y , I , a 1 , a 2 , c o l o u r ) ; 
 
         E N D ; 
 
 
 
 
 
 
 
 e n d ; 
 
 
 
 P r i n t C o u n t ( n u m b e r ) 
 
 b e g i n 
 
 R E C T _ P ( 1 4 5 , 1 3 5 , 1 7 5 , 1 5 5 , 0 , R G B ( 0 , 0 , 0 ) ) ; 
 
 T E X T O U T _ P ( I n t T o S t r i n g ( n u m b e r ) , 1 5 5 , 1 4 0 , 2 , R G B ( 2 5 5 , 0 , 0 ) ) ; 
 
 e n d ; 
 
 
 
 I n t T o S t r i n g ( i n t e g e r ) 
 
 b e g i n 
 
 l o c a l   r e m ; 
 
 l o c a l   s t r i n g   =   " " ; 
 
 l o c a l   n e g a t i v e   =   0 ; 
 
 l o c a l   a s d ; 
 
 
 
 i f   i n t e g e r   = =   0   t h e n 
 
       r e t u r n   " 0 " ; 
 
 e n d ; 
 
 
 
 i f   i n t e g e r   <   0   t h e n 
 
       n e g a t i v e   : =   1 ; 
 
     i n t e g e r   : =   i n t e g e r   *   ( - 1 ) ; 
 
 e n d ; 
 
 
 
 w h i l e   i n t e g e r   >   0   d o 
 
     a s d   : =   i n t e g e r ; 
 
     r e m   : =   i r e m ( a s d , 1 0 ) ; 
 
     s t r i n g   : =   D i g i t T o C h a r ( r e m )   +   s t r i n g   ; 
 
     i n t e g e r   : =   ( i n t e g e r   -   r e m ) / 1 0 ; 
 
 e n d ; 
 
 
 
 i f   n e g a t i v e   = =   1   t h e n 
 
     s t r i n g : =   " - "   +   s t r i n g ; 
 
 e n d ; 
 
 r e t u r n   s t r i n g ; 
 
 
 
 e n d ; 
 
 
 
 D i g i t T o C h a r ( d i g i t ) 
 
 b e g i n 
 
 
 
 i f   d i g i t   = =   0   t h e n 
 
     r e t u r n   " 0 " ; 
 
 e n d ; 
 
 
 
 i f   d i g i t   = =   1   t h e n 
 
     r e t u r n   " 1 " ; 
 
 e n d ; 
 
 
 
 i f   d i g i t   = =   2   t h e n 
 
     r e t u r n   " 2 " ; 
 
 e n d ; 
 
 
 
 i f   d i g i t   = =   3   t h e n 
 
     r e t u r n   " 3 " ; 
 
 e n d ; 
 
 
 
 i f   d i g i t   = =   4   t h e n 
 
     r e t u r n   " 4 " ; 
 
 e n d ; 
 
 
 
 i f   d i g i t   = =   5   t h e n 
 
     r e t u r n   " 5 " ; 
 
 e n d ; 
 
 
 
 i f   d i g i t   = =   6   t h e n 
 
     r e t u r n   " 6 " ; 
 
 e n d ; 
 
 
 
 i f   d i g i t   = =   7   t h e n 
 
     r e t u r n   " 7 " ; 
 
 e n d ; 
 
 
 
 i f   d i g i t   = =   8   t h e n 
 
     r e t u r n   " 8 " ; 
 
 e n d ; 
 
 
 
 i f   d i g i t   = =   9   t h e n 
 
     r e t u r n   " 9 " ; 
 
 e n d ; 
 
 
 
 e n d ; 